﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<common:LayoutAwarePage
    x:Class="Tiles.ImageProtocols"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="This scenario demonstrates different ways to reference images." FontWeight="SemiBold"/>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="Windows supports various protocols for referencing images both on the local PC and from the web. A baseUri can also be provided to use relative URIs for web images. Images must be in .png, .jpg, .jpeg, or .gif format and can have a maximum size of 200KB and dimensions of 1024x1024." Margin="0,10,0,0"/>
                <TextBlock Style="{StaticResource BasicTextStyle}"  Margin="0,20,0,0" TextWrapping="Wrap" Text="ms-appx:///" FontWeight="Bold"/>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="The ms-appx protocol references images that are included in the .appx package. If localized, scaled, and high contrast resources are provided, the correct asset can be automatically displayed." />
                <TextBlock Style="{StaticResource BasicTextStyle}"  Margin="0,20,0,0" TextWrapping="Wrap" Text="ms-appdata:///local/" FontWeight="Bold" />
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="The ms-appdata protocol references images that are saved to the storage folder (Windows.Storage.ApplicationData.current.localFolder)" />
                <TextBlock Style="{StaticResource BasicTextStyle}"  Margin="0,20,0,0" TextWrapping="Wrap" Text="http:// and https://" FontWeight="Bold" />
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    The http and https protocol will download web images.
                    <LineBreak/>
                    Web images can be appended with query strings so that localized, scaled, and high contrast images can be returned by the web server if desired.
                    <LineBreak/>
                    A baseUri can be specified in a notification for web images. The incomplete baseUri will be combined with the relative image path to form a complete absolute path.
                </TextBlock>
                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                    <ComboBox x:Name="ProtocolList" Width="300" SelectionChanged="ProtocolList_SelectionChanged" >
                        <ComboBoxItem x:Name="package">ms-appx:///</ComboBoxItem>
                        <ComboBoxItem x:Name="appdata">ms-appdata:///local/</ComboBoxItem>
                        <ComboBoxItem x:Name="http">http://</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
                <StackPanel x:Name="LocalFolder" Orientation="Horizontal" >
                    <TextBlock VerticalAlignment="Center" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="Select an image that will be copied to this app's local folder." />
                    <Button x:Name="PickImage" Content="Select image" Click="PickImage_Click"/>
                </StackPanel>
                <StackPanel x:Name="HTTP" Orientation="Vertical" Margin="0,10,0,0">
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Base URI " />
                        <TextBox x:Name="HTTPBaseURI" Text="http://www.YourWebsite.com/"  Width="200"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Image #1 " />
                        <TextBox x:Name="HTTPImage1" Text=""  Width="200"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Image #2 " />
                        <TextBox x:Name="HTTPImage2" Text=""  Width="200"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Image #3 " />
                        <TextBox x:Name="HTTPImage3" Text=""  Width="200"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Image #4 " />
                        <TextBox x:Name="HTTPImage4" Text=""  Width="200"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                        <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Text="Image #5 " />
                        <TextBox x:Name="HTTPImage5" Text=""  Width="200"/>
                    </StackPanel>
                </StackPanel>
                <Button x:Name="SendTileNotification" Content="Send Tile Notification" Click="SendTileNotification_Click" />
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>